class eventClass {
    constructor(name, dirName, defaultRet) {
        this.eventClassName = name || (`eventClassName_${(new Date()).getTime()}`);
        this.dirName = dirName || '';
        this.defaultRet = defaultRet || {};
        this.events = null;
    }

    returnMethod(cb, { err, data }) {
        if (typeof data === 'boolean') {
            return cb(err || null, data);
        }
            return cb(err || null, data || this.defaultRet);
    }

    returnMethodAsync(cb, { err, data, status }) {
        if (typeof data === 'boolean') {
            return cb(err || null, data, true);
        }
            return cb(err || null, data || this.defaultRet, status || 'over');
    }

    logMethod() {
        console.log('method is undefined');
    }
}

module.exports = eventClass;
